Skip to content

feat: dedicated database connection per package - #2

Merged
jayjfletcher merged 1 commit into
mainfrom
feat/package-db-connection
Nov 9, 2026
Merged

jayjfletcher merged 1 commit into
mainfrom
feat/package-db-connection

Conversation

@jayjfletcher

Copy link
Copy Markdown
Member

Summary

  • configuration: new "Database connection" section: {package}.database.connection (env {PACKAGE}_DB_CONNECTION, null = default) used by models, migrations, raw queries, transactions and exists/unique rules; no DB facade or injected default connection; cross-database joins caveat.
  • models: getConnectionName() returns $this->connection ?? Tables::connection().
  • migrations: getConnection() returns Tables::connection(); FKs to host tables become plain indexed columns.
  • actions-events: transactions use Tables::db()->transaction().
  • index descriptions updated (within the 400-char budget).

Pairs with the Keystone PR that adds Tables::connection()/db()/qualified() and Arch::defaultConnectionUses().

Test plan

  • vendor/bin/pest (10 passed)

🤖 Generated with Claude Code

Configuration, models, migrations and actions-events now require that a
package's tables, queries, transactions and validation rules follow
{package}.database.connection (null keeps the app default).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jayjfletcher
jayjfletcher merged commit 47235a9 into main Nov 9, 2026
4 checks passed
@jayjfletcher
jayjfletcher deleted the feat/package-db-connection branch November 11, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant